THE ALGORITHM