added in NPC plus bug fixes.