Change arraylist to array