Adds documentation and cleans up indentation