making movement control
correct calculation of unit direction