add a min function to Stack