remove_gates can now remove all occurences of a gate as well