move js to visualizer.js