add both gate pattern