Both Algos implmented