Formatted code
Added documentation