training now passes pointers to datapoints instead of copying the array