Added clarifying comments
Non-semantic style changes
Added documentation