Improved documentation, code style