begun adding some metadata to graph json
refactored js code