algorithm class