Version 1 of the functions that I wrote for programming assignment 2.