upto 2 patterns in book example