update with a simple algorithm