added movement algorithm for npcs