Added comments to matrix functions