jump function corrected to use only one for