Base code for Pi movement