first simple algorithm created