added peak method to stack