matrix rewritten in CS