Add some comments and fix some style.