Added some comments to the main mod file, to explain what various bits of code are doing