Added comments to understand code.