'Try to merge ranges created earlier.
If previous number in a list can be merged with current item under
common mask, it\'s merged. Then it continues to do the same with the
rest of the list.'

def shake(self):

    while self.can_merge:
        self.mask <<= 1
        self.base = self.prev_ref.base
        if self.prev_ref:
            self.prev_ref = self.prev_ref.prev_ref
