Finished the basic code of the function, added notes to the lines. Next I will work on return.