added variable scope; fixed ident match; forced whole input match