Added model and recognition logic