Completed Programming Assignment 2

Added the two functions as per instructions