The so far final algorithm