Better tag calculation