data structures and getting the javascript to build the json