Added comments to code and modified batch file