Changed to make differences with the 'categories' mode and to get the value from the data array