Added a simple algorithm