Fixed my incorrect use of 'def' vs 'val' in Algorithm.