The upper part of the leg is drawn forward by the action of the quads and hip flexors beginning to shorten. The foot continues on an upward curve, with the help of the contracting hamstring and the hinge effect of the knee joint. It swings into the gluteus maximus (backside), so shortening the lever and making it easier to bring forwards.