len(self.history[-set_range:]) to set_range
test