My personal take on algo.