writing to arrays works