add cases for empty arrays, arrays with a hanging comma [1,2,3,]