Part 1 logic.