change functions to compare JSONObjects and JSONArrays