revise JSON paring function and add comments

q