fix, prep2 and pattern order
fix variable
pattern extractor, unfinished