Moved graph generation to new file