adding debug version with visualizer