add algorithm