add and use a triple class, remove things off the stack