implementations for generic stack class