added logic to display hat blocks in text