Changing a list to an array