Implement solution

Implementation details have been added to the bottom of the readme