Added some debugging
Added skeleton for template support