Changes required by Programming Assignment 2
Added implementation of 2 functions and explanatory comments