Having clock number tied to history causes issues on higher clock numbers, as it is effectively a memory leak. It would be better to keep it separate, and add a limit to how large the history size can grow before it starts discarding the oldest records. I also suggest that instead of clock being stored in GuiData it is instead fetched when needed from the simulator.