changes done to SecondMaxElement