Implements base method self.operate

When i read the code, I found for compare's code is much similar, so i think this is more simpler