added flex_bubbles(data,ref_data,kw-scale) funct