Implemented solving up to pair identification