Improved coding style, docs