added json and fixed up a bit of my js.