Implemented draft version of the solution.