style tweeks and some comments to the code