adding untested matrix calculations