calculate most recent unclosed tag
tag string + trigram calculations
fix imports