change algo for special case