Added comments

Wanted to put in some details of what exactly the code was doing and why
I did it the way I did.