use qr to compile once; change level->pattern