added from_matrix model initialization