solving P23