Added comments to make more readable