Adding simple algorithm