Remove debug code
Refactor "algorithm" module