Solve final homework