Added first() and last() methods to Stack class.