changed my mind on algorithm.