Add documentation and clean whitespace