added primitive movement algorithm