Efficient way to code "(symbol,multiplicity)-counting" - how?