fixed NPC walking

cleaned up some code too