apply coding style.

also improve some comments.