Added documentation and indentation