Add NFA style pattern matcher to avoid recursion, debug student