Non-regressing impl of gateS etc