Algorithm for everything