improved testing algorithm