a non-functional solution to prob23