Finished unfinished npc function