splitting and Joining arrays