fixing bubble technique and adding switch for scaling to rate