Worked on implementing the algorithm.