added calculation of z position when jumping