added nmsimplex code