splitting an array and manipulating a string