first version of approx EMD computation