Added comments to explain new functions