Reorganized the ninja's move function