Added getTokenCount() method.