new optimization alg to choose x values