* recursive method to convert all arrays to an object