test algorithm