this is the solution for textbook