Graphing is now a callable function instead of running when DOM is loaded; refresh button added to refresh the graph