Added a few explanatory comments
Fixed merge conflicts