Completed assignment

Created the required functions for Programming Assignment 2.
Revert "Completed assignment"

This reverts commit 81ab7aa4814a0138db8d6388a8918fbb238d2126.