cooks algorithm change