tags parsing and printing