transoforming lists to arrays