slight changes to scheduler and graph creation updated to a reasonable
number of mysql queries