Now thats a sweet algorithm