restructured the solution