add algorithm (T. Weiler)