Better alg