use string as index in ruletable
add rule matching module
change flag variable to goto in rule matching module