algorithm now according to sheets