Fixed bug on line 40 in subsampling data