fixed bug in mds.py

this error is raised in OSX 10.9 with float64: use np.allclose, make code cleaner and less buggy
added not
Merge pull request #2667 from kowalski87/master

fixed bug in mds.py