Implemented a 3-state discretizer (tested once on real data).