Replace connecting and connected flags by numeral states