Starting to generalize matrix.
More things done.