remade choking algorithm