implemented figure movement