Transform algorithm to module.