Updated comments and headers

Added comments to some functions, and changed the headers to be less
messy.