Correct type in algorithms