second version of dist plot