Implemented solution

Implemented the assignment solution.