Changed bubble expansion/contraction conditions.