Matrix used instead of dictionary for units.