fix'ed move algorythm