custom simplex solver (post-experimental)