Implemented the main functionality of the example,
now need to make the changes