Updated the gate logic