Implemented solution.