added grid version of classify