added MDS implementation