Fixed bug with json namespace
Changes suggested by Arthur
Randomizing energy values
reworking with new core code