improving the solution