first part complete and count tokens, types && segments