Added slope to the metric
Moved the size of the array to the max data variable
Moved data collection and storage to different functions by type and added load functions