first working java version of recognizer