A new embedding method based on a Kolmogorov-Smirnov approach