Made small changes to script and added comments to every line