why do you fill these arrays up and then add them to the object in another loop afterwards? Seems like you could just add each property to the object immediately