First version of the solution