Why so obscure? Why not
  densities = x_values;
?