Refactored graphing into a module