added the solution to the homework problem