Use a dictionary for storing the algos for different lengths.