Programming assignment #2. First set of functions