Classify function.