better movement direction calculation