Changed beta_div r script