Add comment

Fixed indent errors in the previous pull request.
Added some comments on several functions.
May be more readable.