Don't keep all data in memory. data up to 10mil

Modified collectdata so that all of the arrays are not kept in
memory but instead generated on the fly. Ran experiemnts up to
10mil.