Thoroughly comment

Beefed up comments for the functions.