bikeshedding continues
factored out the PatternMatrix into a smaller module