updated ai move method to remove jittering effect