minor changes in gates.py