Adding algorithm variant

New algorithm variant and some code cleanup.