Developmentof a classification algorithm for efficient handling of multiple classes in sorting systems based on hyperspectral imaging