add algorithm min