Adding functionality to Stack class.