a simple algorithm as benchmark