worked on algorithm.