Changed dataframe to matrix, significant improvements in speed
Changed dataframe to matrix, significant improvements in speed