updates, renamed input2pattern to buildpattern