Checkpoint selection code.