updated project2 logic for character pairs