Added better manual movement code (untested)