Calculating height using potential energy formula