Using Templates to implement Stack