Recipe algorithm