Added comments to make it more readable