Attempt at creating json, refer to comments in graph.js