A New Control Algorithm for Nonlinear Underactuated Mechanical Systems