A method for solving equality constrained optimization problems by unconstrained minimization