completed trands algorithm, and tested.