Adding code to extract tags and ids