Code for AlgorithmSelection