improved algorithm calling