Added more comments to the file to clean up code.