added initMatrix