added new data structure to hold the data samples.
merged with colton's changes.