Added method to turn list into an array.