Changed gate rectangle combination function into an operator