Changed arrays to objects