Fully implemented gateway opening mechanism #1655