Added my versions of functions for Programming Assignment 2