Code alignment and comments

I have added 3 comments and relaign the code to be easy to read.