Added a parameter (m) to set the size of the data set to be used