Worked on solver algorithm