Refactored recognition engine, add ui