Moved model to matrix