First version of the code. Code created and commented as requested by assignment