Basic functionality, simple algorithm