add template for balance using a Stack