Implemented a version of assignment 2, lab 1.