Added comments, and a few tweaks