Created a function which implements classical multidimensional scaling.