sin function added to control jumping