main.js cleanup and added arrow head to show directed-ness of graph