commit before change
speed up by changing for loop to matrix