added JSON, took out unused variables, chaned syntax