Updated algorithm
Resolved merge conflict