added reference counts to characters and updated styles