cleaning up the code and expanding the comments
Merge remote-tracking branch 'SCU/master'