added json input and output