demo algol fix

basic recognition algorithm