Fixed MDS function