added the min stack algorithm