algorithm switcher implemented