Added comments on source code and some clarifications.