Add and remove gates using commands