How SAGA's algorithm works