added logic to visualizer and service