Updated the solution