created method to sort NPCs according to their dexterity