some documentation and code formatting