Template stack...again... and some more printing and works a little better