add generic-algorithm