Added functionality in methods of the class Pile