Corrected the solution