cosmetic
pattern begin at 0 not 1 and add an interface to keep pattern in memory
pattern begin at 0 not 1