seperated JSON generation code into simToJSON.js