Fixes some bugs. Adds some comments.

- END_SCORE global constant wasn't being properly used.
- Little comments were added. Not all comments to be added were, but
they'll.
- The XOR swap was commented.