rewrote Pattern construct functions