a number of changes to facilitate the visualizer (almost there)