Added better comments to code