added Order field to matrix types, removed global order variable