Refactored code. Algorithm is now a type.