moved graph generator into separate file