started working on algo