Added exhaustive testing algorithm