collect the simple algorithm