algorithm ref