finish matrix