commented the visualization code.  Moved to a closure for the functions so that we reduce the amount of stuff we put into the global space. also renamed some variables to make it a bit more generic.