update code to do recognition with restart, observation ratio