attempts to get history function working, having trouble with double array and segmentation faults