New walking and jumping algorithm