Finalizing the solution