implement a simple algorithm