C matrix calculator implementation