Ready for submission

Implemented the two functions required for Assignment2. Tested.