Modified thread creation to add objects to arrays after creation