Okay it is a bit of spaghetti code but why do I fail the test? I even tried with triple nested tags and the output seems correct....