Edited graph_builder script for generality