Changing some graph code to be able to select variable to graph (not done yet)