Building array correctly?