The offensive player gathers with his right foot on the ground. He then takes two legal steps, before losing control of the ball. After regaining possession, a player is allowed to regain his pivot foot and pass or shoot prior to that foot returning to the ground. This is legal.