solution for problem23