Added documentation and fixed whitespace.