forgot to declare maxpattern