How the simplex method works for nonstandard problems