Simplified remove_gate
Added method to reverse the entire circuit