added NPC logic and spawning