5-23 problem and code