Algorithm Visualization with HTML canvas and JavaScript