NPCs now move according to the rules
also cleaned up the code and commeted it
Improved rules