functioning notes algorithm