moving to matrix