Fixed algo. Kept old