Made URL dynamic, also added some comments to the code