CABINET ALGORITHM