Adds inline documentation to fix and cleans it up a bit