fixed patterns

also some useful debug lines