Changed newArray fucntion to make it a method in json1