updated the code to tuse the new transition builder and to have recognizers