Algoritm works, needs to get implemented in the system.