changed nextSymbol() to use the flyweight pattern, so that we don't
create new symbols all the time but re-use the ones we already have.
They're stored in hashmasp that are accessible through an identifiers.