Add more code documentation.
Code style improvements.