Update Gate.cpp