Minor changes to movement algorithm