made the variables in the invasion percolation algorithm self._var instead of self.var