Hello and welcome to the session. This is Professor Farhad in which we would look at CPA questions that deal with the revenue cycle. This topic is covered in an auditing course as well as the auditing CPA exam. As always, I would like to remind you to connect with me on LinkedIn. If you haven't done so, YouTube is where you would need to subscribe. I have 1,700 plus accounting, auditing, tax, finance, as well as Excel tutorial. If you like my lectures, please like them, share them, subscribe to the channel. If they benefit you, it means they might benefit other people, share the wealth, connect with me on Instagram. On my website, farhadlectures.com, you will find additional resources to supplement your accounting education. For example, if you are taking an auditing course, I do have a full auditing course on my website. If you are studying for your audit CPA exam, I do have a section for the auditing CPA exam. If you are serious about passing your exam, if you want to put those 10 to 15 additional points on your CPA exam, I strongly suggest you check out my website and this is my auditing course. Let's start with looking at some questions. Just again, I've got familiar with this process. Once again, if you need more additional explanation about any particular topic, I strongly suggest you visit farhadlectures.com. Which of the following involve a theft of receivable followed by a delay in the posting of credits to a specific customer account? Is it kiting or is it lapping? Or is it both? Or is it neither? So simply put, do you know the definition of kiting? Do you know the definition of lapping? If you do, you'll be able to answer these questions. So basically, this is a definitional questions part of the revenue cycle when you're auditing the revenue cycle. And simply put, when you steal money from an account receivable by delaying the posting of crediting to a specific customer, the process is called lapping. What is lapping?  And those $5,000 supposed to go into account number A, B, C and E. And E, let's make it E. And also just to make this simple, each customer, they paid $1,000. So each customer will have $1,000. So you're supposed to post those $5,000 to each account separately. So what you do, you post for A, B, C and D, and you pocket this $1,000. So A, B, C and D, the account is updated, and you pocketed this $1,000. You just use it for your own personal use. Now the following day or day or two later, you would receive another $5,000. Now, those $5,000 is for F, G, H, you guys get the points. What you do with this new $5,000, you'll pay E and you will keep one customer unpaid and the process repeats itself. So this is what lapping is. It's the stealing of a receivable followed by a delay in the posting of credits to a specific customer. Now how can a company eliminate this type of fraud, eliminate lapping? Basically what you need to do, the person that post to the account should not also deposit the money. So we have a segregation of duties. Depositing the check and crediting the account should be two separate people. This way, you can do it. You cannot keep your money for yourself. Kiting is what is kiting. Kiting is when you make the money appear in two different bank accounts at the same time. And I do have a recording about kiting. But the definition that you're being asked about is B lapping. And I talk about lapping in my auditing course as well. Let's take a look at this revenue cycle. Which of the following department prepares the sales order and improve the customer for credit? So which department prepares the sales order? Well, it's the sales department. So immediately you could eliminate A and B because it's the sales department, the sales department. Which department authorizes the credit? So which department says, yes, it's okay. We can sell to this customer. They have a good credit. Well, for one thing, if you're down to 50-50, the same department should not do both. So you could immediately eliminate D and keep C. But you have to understand why C. The people in the sales department, they might have every incentive to approve the sale. Why? Because their performance could be based on sales. So they have every incentive to approve every sale. Therefore, you don't let them approve the sales. Because that's basically a violation of segregation of duties. You would have a credit department that's separate to authorize the credit. Think about one. I'm sure some of you experienced this. When you go to the mall, well, not these days with the COVID-19, but when we used to go to the mall, what happened is they'll say, oh, why don't you open a credit card?  So what they do when you open the credit card, the person that's selling you that's making the sale doesn't open the credit card for you. Usually they have to call an 800 number. Or they ask you to go on a computer and input the information. Simply put the sales department the person that's making the sale cannot also approve your credit. A credit department will have to approve whether we should sell you on credit or not. Therefore, the answer is C as in Charlie. C as in Charlie. Let's look at this question. Within the proper segregation of duties for the revenue cycle. Again, we're talking about the revenue cycle. Which of the following department represent an example of custody? So you have to be familiar with the revenue cycle, which department are involved. And simply put here that they're asking us which department is considered custody. Custody means they hold the asset. Now without knowing anything, you might be able to answer this question. So who holds the product, custody of the product? Well, what can we do immediately? If you're looking at ABCD, if you know anything about the revenue cycle or the purchasing cycle, you could eliminate C. Why? Because the receiving department is part of the purchasing cycle, which I also cover. And I might do a session about the purchasing cycle. So immediately you could take out C. The receiving room is part of the purchasing department. So it's not part of the revenue cycle. You could also take out B. And hopefully you know why? Billing is accounting. So it's not part of custody. And remember, accounting, if it's a billing is accounting, accounting cannot have custody. Remember, those two things, they have to be separate. Accounting and custody, they cannot be combined. If you have access to the record, which is you have access to the accounting record, you have access to billing, you should not have custody of the asset. So B is a no-no. Well, think about it now. You're down to 50-50. If you want to take a guess, which one is the custody? Is it the shipping or is it the warehouse? Who holds the asset? The warehouse holds the asset. So what's the... So but the shipping also get their hands on the asset because they ship it. Yes, shipping, they execute the order. Shipping also, they work as a reconciliation process. What do I mean by reconciliation process? Remember, the shipping department, they're going to be receiving two different things. They're going to be receiving a sales order from the credit department. From the credit department. Remember, the credit department approve the sales order. They're going to be receiving the sales order from the credit department. But also, what they would also receive, they would receive a sales order from the warehouse. Also the warehouse, sales order from the warehouse. Why? Because the warehouse, my pen is acting up, because the warehouse kind of transferred the goods to them, to the shipping people with a sales order from the warehouse, and they basically, they match those two. Say they reconcile, then they ship it, then they prepare the shipping document. So that's why it's an execution and reconciliation, not custody. Custody is a warehouse department. And hopefully by just using your common sense, you should be able to kind of, you should be able to kind of, well, think custody, the warehouse, the warehouse have custody of the product. Let's take a look at this question. An auditor begins with a sample of bills of lading and traced forward into the accounting record. If a sales invoice was not found for a particular shipment, the auditor could suspect that goods were shipped out fraudulently on consignment, one, both, neither, so on and so forth. So first of all, do we know what bills of lading is? Bills of lading is basically the carrier. For example, let's assume you drive a delivery truck and you, that's all that you ship product from one company to another.  Who's the consignee? Where are you shipping from? What's the destination? And what are you carrying basically? So if the auditor starts with this document, then trace forward into the accounting record. What do you expect to find? If you have, if the company shipped something, you expect to find a sales order.  There's no sales order. That's what we're assuming. What could you suspect? Well, you could suspect fraudulent, shipped out fraudulently. Sure. Somebody could be stealing, stealing from the company. There's no sales. Why did we ship it? Who are we shipping it to? So A is correct. So one will still, one would survive. Two will be out. D will be out. Now all we have to know all we have to know is, is too correct. It could be goods on consignment. That's also correct. If we're shipping something goods on consignment, it could be both A and B. And always for goods on consignment, I give this example PepsiCo, PepsiCo, Pepsi and Walmart. So what happened is Pepsi, they ship goods to Walmart, they ship goods to Walmart. And when they ship goods to Walmart, they don't really sell it. All what they do is they ask Walmart to place the product on their shelves until Walmart sells it.  Well, but you don't see a sales order because they were shipped to Walmart. They're goods on consignment. We can, we cannot record. There's no sales order until Walmart sells them and we record the sale. So it could be both. It could be either fraud, not both. It could be either fraudulently. This shipment is fraudulent. Or it could be that we ship it goods on consignment to a third party, to a second party or third party for the company for sale. It could be either or. As always, I would like to remind you to visit my website if you have any concern about these topics and visit my auditing course where I covered revenue, cycle and debt, as well as other accounting topics. One subscription give you access to all my, I believe 15 different module or 20 different module and material and courses, especially if you're studying for your CPA exam, you can add 10 to 15 points. Good luck, study hard and stay safe during those coronavirus days.


Welcome back to 353. Thank you for joining me on this wonderful Friday. That's slightly underattended, but we'll push through it. So where we left off last lecture, we were talking about virtual memory, how you would implement it. And we figured out that, hey, we should probably just do some type of mapping. Arrays are fast, so we'll do something called a page table where we essentially split up the address and only deal with memory and fixed size blocks called pages, split the address, and then use the virtual page number to look up the physical page number. And then we're off to the races. But we argued that even for a 39-bit virtual address, our page tables had to be ginormous. They had to be a gigabyte each. And they'll be independent for each process. So that would be bad. So what should we do about the page table size? So one note most system designers make is that, hey, most processes or programs don't use the entire virtual memory space. So how can I take advantage of it? And the simplest answer to that is, well, if a huge page table is the problem, I will make a smaller page table. And then, boom, you collect your bonus check for being so brilliant. So I just make it smaller. That's the solution. So we're going to do it in a bit of a clever way. First off, I'll start with just one step. So for now, we're just going to make each page table fit exactly on a page. And it will become apparent why we do this later. But for now, we'll just assume a single page table. So if we have a single page table that fits exactly on a page, remember our page size would be 2 to the 12. So it's 4,096. And our page table entry, well, it is 8 bytes or 2 to the 3. So we could fit 2 to the 9 entries on our page table to fill it up. So this 2 to the 9 times 2 to the 3, well, that's equal to our page size. And we'll just make a page table that in this case, it only needs nine bits to actually index it. So in other words, it only has 512 entries. So now we'll also add this SATP, which is essentially going to be the root page table. So the actual MMU hardware, all it needs is it needs to know where to start doing the translation. So it needs a location of the page table. And that's just specified in a register that the kernel goes ahead and controls. So on risk 5, it's called SATP. But it's basically the root page table. And just tells the MMU where the first page table is or where the page table is for this process. So here, that page table to the 9 entries. And each page table entry would have a PPN and at least a valid bit. In this case, same scheme we had before where the PPN is 44 bits. We had 10 bits for permission. And then we didn't use the other 10 bits. And similarly, we have the offset we don't have to translate. So any questions about this? All I did is take last lecture and just make the page table smaller, such that it fits exactly on a page. OK, now we get, yeah. So what it means by it fits exactly on a page is our page size is 4,096 bytes. So I want all the page table entries to fill that up exactly, yeah. So I'm just restricting the size of that page table. All right, so why in the blue hell would I want to do that? Well, this is where our minds start to break and why this is hard. Takes a bit to wrap around it because this is the full picture of how we translate virtual memory. So we do something called a multi-level page table to save space for programs that don't use that many virtual addresses.  We would need a gigabyte. What we do instead of doing that huge page table is we split it up into different levels. And how does that work? In this case, we need three levels of page tables. So how it works is that each level of page table, we break it down to a smaller size, and they each fit exactly on a page. So how translation works now is a bit different. So we take this virtual address, and instead of just having one big virtual page number here, we split it up into nine-bit sections here. So in this case, in order to get a full 39 bits here, well, I need three of them. So nine plus nine plus nine plus 12, that gets us our 39 bits. So they're split up into different levels. So typically, we name the highest level, some number, all the way down to the lowest level, which is L0. So in this case, there's L1, L2, L1, and L0. And this is in no way connected to the name for CPU caches at all. So how translation actually works is there is still this root page table register that tells the MMU where to start the translation. And what it does is it points at a level two page table. So your level two page table would have two to the nine or 512 entries. And what we had before was, okay, we look up that entry, we get the PPN, check that it's valid, and then we just use that for the physical address. Well, now we do it in a bit more of a roundabout way. So the PPN here doesn't tell us the final translation, it tells us that is the physical page number of the L1 page table. And then we jump to this page table and the MMU knows to use this page table to figure out, we use this page table for the L1 entry. So then we know what index to use from the virtual address, we go into here, then we figure out, okay, which entry does that correspond to? We get a PPN for that. And then since we get a PPN for that, that tells us where the L0 page table is. So the MMU would then use this L0 page table, get the index from the bits from the virtual address, look it up, and then finally in the L0 page table, the lookup is exactly the same as when we had a just one giant page table. So the PPN in this page table entry, that's what we use for the physical address, and then we're done, thankfully. So we'll be talking about this all day. So any initial questions about this, we'll do some examples and stuff, yep. Sorry if I'm getting confused with the two to the power nine page table, the same size of page, because it wouldn't be two to the power nine and then there's 64 bits per entry. And isn't the page table size supposed to be 12? So we do it in bytes. So it's two to the nine here, which means we can address up to 512 entries, and each entry is going to be eight bytes. So eight times 512 is 4096, that's the size of our page. Why is the page also determined? Yeah, so the offset is like, you have to be able to say what byte on a page you want. So I have to say what byte on a page I want. So it has to be two to the, however many number of bits I need to be able to say, I want byte zero, I want byte 511, I want byte 4,000, whatever. Okay, any other initial questions with this? We'll have examples, so yep. Can I only have one, what, sorry? Yes, yeah, so you can only have one SATP, so there's only one L zero page table per process. So it all starts there. So SATP in this case, since we have three levels of page tables, that will point to the L two page table to use. Yeah, so, and that would be set by the kernel per process. Yep, so we could have two to the 19 different L zero page tables to the 18. Right, because we have two to the nine choices here, and then for each of these two to the nine choices, we can further go on to two to the nine. So we can actually, if you actually look at this, we can actually map the same number of pages, but we're actually gonna waste a bit more space if we have to map every single page, right? Because to map every single page I'd essentially need a gigabyte worth of L zero page tables, but I'd also need L zero page tables to point to them, and then one L two page table. So it's actually slightly worse for space if you use everything. But the idea here is at minimum, to only translate a single address, I just need like one L two, one L one, and one L zero. Yeah, so all of these page tables will have a physical page number in them. It's just what they refer to. So in the L zero page table, that physical page number is going to tell us the physical page that the next L one page table is at. So they'll all be saying physical memory. In every other page table except L zero, they tell you the page of the next lower page table, and L zero it tells you the page for that mapping, like the final mapping at the end. Yeah, this is for literally, this is the scheme that's used for any program. Yes, so if a process is using 512 gigs of memory, then yeah, we're stuck. We have to keep the translations anyways, so we can't really do much better than using a gigabyte. So at minimum, we need one of each. So to translate a single address, I need one L two page table, one L one, and one L zero. So I need three pages to translate a single address. So if the program only has to translate a single address, three pages, before when I had a giant page table, even if I need to translate a single address, I still need that gigabyte page table. So this is only good for programs that don't use all the memory, which is every single program except for Chrome. Man, picking on web browsers is easy. All right, any questions before? We'll do an example just in case. So first, let me brief detour because this actually makes memory allocation really, really simple if you are the kernel. So if you are the kernel, to do memory allocation, since we separated out memory into pages, you just do memory allocation a single page or block of memory at a time. So whenever you boot up your system, you can just take all the physical memory, divide it into physical pages, and then the kernel just maintains a free list, which would just be a link list of all the physical pages, so they just link one to the other. They're not being used by the program so they can store a pointer. And yeah, so the unused pages themselves, they store that pointer, it would get initialized at boot. And then to allocate a page, really simple if you're the kernel, you just remove it from the free list and use that page for your allocation. And then whenever you need to deallocate that page, you just add it back to the free list. And since you're keeping track of the mappings, one page is as good as any other page, you don't actually care where it is in physical memory. Okay, we're fine. All right, so here is some more explanation to our insight of using a page for each smaller page table. Because the kernel can, if we just do that optimization, the kernel just has to allocate pages. It doesn't really care for what, it doesn't have to have a separate allocator for page tables and a separate allocator for pages that the process uses for actual memory. Just can use the same thing, just gives a page and then we decide what to use for it. So in this case, just to be really explicit, so in this case, the reason why we have two to the nine entries is because all of our entries are eight bytes each in this case, oops, eight bytes each in this case, and they have to fit on a page, which is 4096. So we can figure out that, hey, this is two to the 12 divided by two to the three, that's two to the nine. And the rule, no matter how many levels of page tables we have, level N always points to the page table for level N minus one, and then we just follow this blindly until we hit L zero, and then that contains our final lookup, that's the physical page number for that virtual page number at the end. So just also to be clear, the page tables, just think of them as arrays. So if I had something like int page table 512, quick off the top of your head, how many bytes is that? What's the size of that array page table in bytes? How many? 2048, right? Yeah, 2048, so an int is four bytes, and if I have 512 of them, that means it's 2048. All right, so remember I talked about offset, it's just like the number of bytes from the beginning something is, so if I'm like accessing the index two of this array, what is the offset at index two? It's that gang sign, what was that answer? Eight, eight, right? So an int, it's four bytes, so index zero is at byte zero, offset zero, first thing's at the beginning of the array. At index one, it would be at offset four, so it's four bytes after because an int is four bytes, so index two, that would be eight bytes into it, because while the size of an int is still four. So, oops, so think of the page table entry is the exact same way as it's an array. So all I do is instead of saying int, I just say page table entry. So in this case, if I have an array of page table entries, well, the size of this page table, which should be 512 times the size of whatever the page table entry is, in the case of the default 32-bit three-level page table, it is eight bytes, so these equations should always hold, even if I just come up with some random memory system. So the size of the page table should be exactly the same as the page size, and then the size of the page table should just be the number of entries in the page table times the size of the page table entry. Nothing really, hopefully, they're just arrays, right? Any arguments about being arrays? All right, so let's consider, let's go over a translation just with one additional level. So in this case, with just one additional level, it will be like a 30-bit virtual address. So say my virtual address is this long thing, yikes, that looks bad, but I divided it into here, this is the L1, this is the L0, and then this is the offset. So instead of all that, let me just switch to this and go through it. So in our scheme, we will have a 30-bit virtual address, and it'll use that good old SV39 scheme, although, well, sorry, be like SV30. So in this case, when we write out our address, it'll still have the same section, so it'll still have offset, and then previously we had this whole thing as a virtual page number, but now because we are using a multi-level page table, then we're going to split it off into smaller page tables that fit exactly on a page, in which case for each level, we need nine bits. Nine bits, and then our offset is still 12 because our page size is still 4096. So questions about that. So nine plus nine plus 12 equals 30. All right, so as long as I'm not crazy. Okay, as long as I'm not mathematically crazy. All right, so our address was something like 3FFF008. So I know, thankfully, I don't have to translate the offset. The offset's a nice number, so 12 bits, that's three hex characters. So I will just write it like it was 008. Don't have to translate that. The rest of the address was FFFF3.  So how I designed it is it's just 11111, so three. It's all ones for L1, and then all ones for L0. And then the offset is the same. So far, we're good with breaking it up into those parts. Okay, so to translate this address, we need to know what L1 page tables start off. The question would probably tell you where it starts off. So in this case, let's assume it starts, I don't know, at P, oops. So SATP, or the root. It might start at something like, I don't know, PPN7. So if it starts at PPN7, that means that the contents of that page table stretch on from 077. 0 all the way to 7FFF. So that entire page is going to contain all of the page table entries for that L1 page table.  So the SATP is just the register that holds the root page table. Yeah, in this case it would be L1. So in this case, like this is what's in the SATP register, just physical page number seven. And that would be where the L1 page table is. Yep, that's a register in the CPU and the MMU uses that one. Yeah, so that's basically like your page table. So if you context switch to a different process, it would just change that register so it points at that process as root page table and then we're off to the races. All right, so since it fits on a page and we're not doing anything weird, well, what indexes L0 or L1? What L1 index do we want to use? Or how good are we at knowing the maximum number that's in a nine bit number? Yeah, seven one FF, so this is our L0 index as part of the address to use. So what is that index, I don't know, in decimal or something that we can understand? Two to the nine minus one should 511 essentially, right? So how this translation will start working is on this L0 page table, we will use this index from the address. So we go ahead, we look up in here, we figure out what the page table entry is at essentially index 511, and it should tell us two things like the PPN and then whether or not it's valid or not. So let's say the PPN was at like 0.8 and it was valid, then what that means is okay to follow through and do the next step of this translation. We have to use the page table at page eight, which would be all the addresses from 800 all the way to a FFF and then we treat it as the L0 page table. Which thing? This? Oh, so if I'm at physical page number seven, it means all of these actual physical addresses are all on the same page. So remember for like our physical address, it always looks like PPN and then an offset, right? So if I'm able to access any single byte on that page, well PPN is seven and then I'm just saying all of the possible values that this offset could be. So it could go all the way from the offset being all zeros to all being Fs and you can go over that range just to double check. This is 4,096 bytes. So it kind of makes sense, right? Okay, yep. So here the eight bytes would just be like the size of this thing. So yeah, the eight bytes is the size of the page table entry. Bites, bytes, yeah. Memory always byte addressable. Yeah, so memory always is gonna be byte addressable. Each index is a byte. And then yeah, part of the address, that's bits because we get to select what byte we want. Right, offset is essentially what byte we want. How many bits do we need to select all the bytes we want? Okay, so where are we? So yeah, now we know where the L zero page table is. It's on physical page eight, which is addresses 800 all the way to 8FFF. So here it's the same index, except we would look it up in this page table. And then in this page table, we'd get a page table entry at 511 as well. Maybe it's something cooler where the PPN is, I don't know, cafe and then it's valid. So since that is our entry in the L zero page table to get the final physical address for what we have before 3FFFFF008, same rule as before. We just replace the whole VPN, which is this, with the PPN, which is now cafe, and then we keep the offset the same. So our final resulting address after all that time is cafe008. So questions about that, yep. So the 11111, they're not stored in L one or L zero. It's just how we broke up the virtual address. We're trying to access<PHONE_NUMBER>. Yeah, so this would be your program trying to access this. And then, So that's a virtual memory address. Yeah, so this would be the processes virtual address. And then the other components are, your kernel is going to set, it's going to manage all of these page tables. So it would set SATP for that process, and it would actually fill these entries in for each page table, and that's it. And then the MMU would be responsible for using those page tables to actually do the translation. So we're doing the job of the MMU here. So SATP, that's just pointing to the root page table for that process. So that's all we needed, right? So, So the L zero, for example. Yeah, so the only two things we need to like, translate a virtual address like this, all we need is the root page table, and then that's it. So you're wondering if everything uses virtual memory, how does the kernel know to, Where to start. So everything in the process is virtual. So kernels can either one, only use physical addresses and turn off, you can turn off the MMU. So the kernel can either use physical addresses or the kernel has to play a fun dance where it uses its own virtual memory. So the kernel would have an L two page table dedicated for itself, and it has to make sure that when you do like a system call, that's part of what has to do. It has to switch to its virtual addresses because it doesn't care about yours. And then do stuff and then it manages everything. So you can see once you get into the like, how to actually manage page tables while juggling other processes, it gets a bit tricky, but hopefully for a single process, it's not too bad. All right, any other questions about that chicken scratch I just wrote? Oh yeah, so it'd be cafe zero zero eight. Yeah, everything would be like leading zeros for everything. Yep. Well, I didn't just come up with cafe zero zero eight. So the physical page number came from here, right? In the L zero page table and the offset remained the same. So the offset was always the same. So it's no, that was part of the virtual address. Oh, the cafe was, yeah, that was in the L zero page table. They're highlighted in green. Yep. So yeah, the eight that we got from the L one, that doesn't factor into the final PPN at all. All that told us is where the L zero page table is. That's all it told us. And then the MMU would use that, figure out where it's actually located in memory. So yeah, you might also notice that, hey, this might actually waste a bit more space. So let's assume each process would have like a single L one page table that could point to two to the nine different L zero page tables, right? L zero. And then each of those page tables, the L zero page tables, well, they all fit on a page. So they're all like to the 12. So our total size here is going to be like two to the 12 times two to the nine for the L zero page tables. Plus we would have a single page for our L one. And if we do the math on this, was that that's two to the 23, which is, if I take it into prefixes, that's the same as two to the one and two to the 20. And two to the 20 is a megabyte and two to the one is two. So that's like two megabytes. Throw a little I in there because that means powers of two plus four kilobytes. So I need that much space to manage all the page tables if I had to map every single address, right? Well, if I just did one big page table and split up that 30 bit virtual address, it would be like 12 bits for the offset and then 18 bits for the VPN. And then, well, turns out my page table would be what? Like two to the 18. So I can have up to two to the 18 entries and each entry is two to the three. So that by itself is the same as two megabytes. So I'm actually wasting a space, if wasting a little bit of space, if I have to map every single address, right? So if I just had a single large page table, it would always be two megabytes. If I had two levels of page tables, this is my worst case of I have to map every single entry. So it'd be slightly more, but the minimum is what we care about. So in order to translate a single address, well, still needs two megabytes if we have a single large page table. To translate a single address, if we have multi-level page tables, we just need one L one page table that would point to one L zero page table. And then that's it. So we only need essentially two times the size of a page or eight kilobytes. So I'm in. Right, so it's a little bit more wasteful if we have to actually map everything. So questions about that. Yeah, I don't need them. So like in this example, to translate this single address, I only actually needed two smaller page tables, right? I just had an L zero. That told me where to go find the L one. And then my final translation was an L one. I only use two pages here. Yeah, yeah. So if the kernel had to start your process out from actual scratch, you'd have one L one, one L two, one L zero. So you can map an address. And then the more addresses you need, it would just fill up entries with pages until eventually that's full. Then it needs to get a new L zero, make an L one entry point to that and then try and fill that up. When that fills it up, it needs a new L one. Da, da, da, da, da. So yeah, what if you have to fork a process that already has a page table? You get to copy its page table. Yep, yeah, so just to make it clear, in lab three, you get to do the job of fork. So you get to clone the page tables. Fun, trust me, it's fun. So here, as an example for lab, so we can even go over a little example. So just to make it clear, I wrote an MMU simulator for you so you can go ahead and try this out yourself. So here, I just checked that my page size is actually equal to 4096. And I showed the steps for how to actually go ahead and allocate, or how to actually do the translation. So this would be done in your kernel and this allocate page would return a new physical page for you. So I just wrote a user space version of it that gives us a page to simulate. So I'd have to create a new L two page. So I'm going to go all the way back to here. Da, da, da. So going back to the scheme where we have our full three level page table. So we have L two, L one, L zero, and then finally we get the address. So in this case, I need an L two page table. So I asked for a page and I'll say, I'll go ahead and use it for an L two page table. And then to simulate that register, that root page table, I just have a global variable here, where I just set it to say, hey, this is where the L two page table is. Then after that, I need an L one page table. I'm going to translate the address ABCDEF. So like this would be the offset. And then whenever we do the translation, we would have to get the indices from this ABC. Whoops. And in order to save ourselves the effort of writing it out in binary, I already did it for you. So it would have leading zeros. So in order to translate that address, the L two index it would use is L is zero. So then I get an L one page table. Then I create an L zero page table. And in that L one page table, I make index five point to that L zero page table. So in this case, we'd have index five if we wrote this all out. And then the last part is going to be index two or one 88. So do you want me to write this out in binary to figure out where I got the indexes from? Are we good for that? Good? Okay. I will not write it out in binary. Hopefully you won't have to write it out in binary. So if I write this, so if I go ahead and call this MMU function, this MMU function uses a root page table, falls it all the way to L zero and then gives us the final address if it's valid. Here I put in cafe for the PPN at the last level. So if I go ahead and I run that, I should see, well first, assuming all my indexes are correct, what is the physical address I should get for virtual address ABCDEF? Oh, whoops, I'm covering it up. Yeah, cafe DEF as long as I set it up correctly, right? So if I set it up correctly, while all my indexes should go all the way until I get this entry in my L zero page table. And here it just creates a page table entry from the PPN cafe. So it should keep the offset the same and just replace the entire virtual page number with the physical page number, which is cafe. So it should be like cafe DEF, right? All right, let's see. So yeah, I got cafe DEF. And I have the MMU such that it will go ahead and check and see if all the entries are valid. If any entry is valid from like L zero all the way up to L one, if it hits a valid at any point and trying to figure out that address, you will get a page fault and this is your seg fault in your program. That's what's actually happening in the operating system. The MMU is just saying, hey, I can't figure it out. Generates an interrupt to the kernel. The kernel might pass it up to you in ways of a signal. So questions about that. So let's play with addresses. So if I did something like, is that address going to page fault yes or no? Yeah, it shouldn't, right? It's still on the same actual page. So if I go ahead, what the hell did I write? 94, whoops, okay, don't know how that got there. So yeah, that doesn't page fault either because it's on the same page, right? So every single kind of work and even like 0, 0, 0, that will still work because it's also on the same page. So you know how sometimes your program works even though that address is definitely not valid, like you overstepped the bounds of an array. Guess what, the address was just on the same page.  So that's why it's not smart enough to give you a seg fault for just random size arrays because, well, you're on the same page and it happens to be valid, neat? All right, so if I want the next one up, if I did this, is this gonna be valid? Probably not, so it should die if I try to translate that address. Yeah, it gives me a page fault. If I want it to be valid, all I have to do is like, I know from this virtual address that it's just essentially going to use the next index up. So it's going to follow all the way until the L zero page table and then in this case, it would use index 189. So if I wanna make it valid, I'll just change this to 189. And now, hey, guess what? It's valid. If I want to change what physical page it goes to, I'll just change it here. Let's have beef for dinner. So let's just beef zero, zero, zero. Questions about that? So weird things you can do in your process too is since the kernel is managing the page table and you have some say over it, you can do silly things. You can do that. So here I have two virtual addresses. You would assume that they are completely independent, but if I go ahead and set up the page tables like that, hey, guess what? They map to the same physical address. So you can change one variable that's completely unrelated from another one because, well, the operating system decided to map it to the same physical page.  And we can do any other mapping. So any other questions about this thing? Lots of fun to play with, yep. Yeah, yeah, so in this example, so this is all in a single process. So this would be like all the page tables for single processes, but you could set it up that, hey, in one process, this address maps to this physical and then in a separate process, this address maps to the same physical page. So you could absolutely do that if you want. That's one way to share memory and you're not even aware you're sharing memory. Kernel can also do a bunch of fun things. No, I shouldn't explain that yet. But yeah, any other questions about that? This, we're gonna also go through this again in the next lecture because yeah, it's one of the most more confusing things I think people have. All right, also to note, one of our goals of virtual memory was to make it like really, really fast, right? Almost as fast as actually just using physical memory. Does that seem fast? No, this does not save time. This is way worse. So if I had a single large page table, right? If I wanted to figure out the physical address of a virtual address, how many memory access do I need to figure that out? One, right? I just look up its page table entry and then figure out where it is and then do the original memory access. Oh, even that's twice as slow. All right. So if I have two levels of page tables, how slow is it? Well, here I have two lookups. So I looked up L1, then looked up L0, then did the memory access three times slower. In the case of this, where we had three levels of page tables, oh, we have three lookups in the original memory access. So it's four times slower. Yikes, we created another problem. So we saved ourself in space, but we actually made it slower, which we get to solve in the next lecture. So just remember, pulling for you, we're all in this together.


Welcome to Ancestral Health Today. Evolutionary insights into modern health. Welcome to Ancestral Health Today. I'm Todd Becker. In today's episode we're talking with Dr. Deborah Gordon about bringing ancestral health principles into the doctor's office. Dr. Deborah Gordon is a medical doctor who trained at the University of California in San Francisco and practices family medicine in Ashland, Oregon. She runs the health website DrDebraMD.com and is a member of Physicians for Ancestral Health. Dr. Deborah integrates conventional and functional medicine, diet, sleep, exercise, sunshine, stress reduction, and other lifestyle enhancements into our medical practice. In recent years she's expanded the same health principles into our work with aging patients, particularly those with issues of dementia and osteoporosis. She's an author on one of the great recent published studies, Precision Medicine Approach to Alzheimer's Disease, with highly successful results.  Her current practice is at Northwest Wellness Center in Ashland. Well, many of us who are inspired to eat and live by ancestral principles find it challenging to talk to family physicians or specialists about using dietary approaches or natural alternatives to conventional medications to control cholesterol, hypertension, osteoporosis, or even mood related conditions. So in our conversation with Dr. Gordon today, we'll get some insights into how she combines the best of conventional medicine with the power of evolutionary health principles, grounded and peer reviewed science, and practical experience. And maybe she'll give us some tips on how we might better communicate and work with our own personal physicians to achieve health goals. Well, welcome, Deborah. Thanks, Tom. I'm great to be here today. Yeah, so before we get into your medical practice, I'm interested to hear more about your own personal experience with ancestral health. What was your gateway into paleo and ancestral health ideas? And how did you learn about it and apply it in your own life? I'm not one of those people who said my health was terribly crumbling and only paleo principles saved my life. I've always been really blessed to be pretty healthy. And my first interest in diet and lifestyle principles or questions had to do with nutrition. Remember Adele Davis back from when we were children? And I expanded that a little bit and really through the Westinay Price Foundation, which is a very interesting nutritional organization, but very limited in a broader lifestyle perspective, came upon some paleo principles and went to paleo FX the first time, I don't know, over 10 years ago and really had my mind blown and opened that, Oh, my goodness, this is my tribe. And there's a lot of refinement. There are a lot of tribes in the paleo world. But to work with people who are both laypersons, physicians, professionals of other sorts who are interested in the quality of quality of what you eat and asking questions and not having all the answers and having a healthy lifestyle. It it was eyeopening and through a connection at paleo FX met the people involved in physicians for ancestral health and ancestral health society. So it it was a great and expansive experience to step into that world. It really was. Yeah, that's great. Interestingly, you mentioned Adele Davis.  And so that was kind of an early connection for me. And also, as you mentioned, the Westin Price Foundation and his great book. Yes, nutrition and physical degeneration and physical degeneration. Yes. And his principles, I think, still hold water. They they're admirable. And I think he would be more paleo these days than being bound in by the confines of the Westin A Price Foundation. Interesting. Okay, well, let's shift then to your career as a doctor. How did you start out as a new doctor? And what was your practice like in the beginning? And how has that evolved? I came to medicine kind of circuitously, I'd been a legitimate hippie, you know, before that living in a TP. So when I got to medicine, my interest really was in, well, let's back up a little bit. In medical school, my favorite topic was physiology, you know, how things work. And I either hallucinated or had a genius of a pharmacology professor who said, my drugs that I'm teaching about should be your last resort, you should always use personal care recommendations first. Nobody else remembers that who went in my class, but it was notable to me. So I started out doing family practice, I started, I moved to Ashland not long after I finished my training. And I directed the migrant farm worker clinic here. And they were in general, pretty healthy people. So we could follow normal prenatal care and deliver babies and watch minimal health problems and try and address those best we could given that these people were often working in the fields or had few resources. But it was a proactive forward thinking kind of practice that was great. And had its limits. And I moved on and I was I really became disenchanted with conventional medicine for quite a while. And strayed farther away into alternative forms of treatment, saying to people, I can measure your blood pressure, but let's try alternative means and I'll help you get it down and I'll warn you if it doesn't go down. I have that those stoppers on either side, but I'd like to help you get healthy without taking the drugs. Well, what's the seed of your disenchantment with conventional medicine? I believed with that pharmacy. Well, so when I was early in my practice, I remember a woman to whom I gave an antibiotic prescription. And she said to me, Oh, I had a terrible side effect, this side effect and that side effect. And I rolled my eyes as a very self important doctor and said that's impossible. And it wasn't long before I realized, Oh, no, that was very possible. She was right. And any drug and for that matter, any supplement or any dietary intervention can have any side effect. And you really have to pay attention to each individual patient, you could give 10 people vitamin C and one of them has a terrible reaction to it and can't take it. So it was beginning to listen more to my patients, stick back in the realm of diet and lifestyle and really remembering what that pharmacologist said, which is that these drugs have side effects, immediate and long term that should not be minimized. Really, really good observations there. So then you were working with this clinic, the farm worker clinic, how has your practice evolved? What are what kind of patient groups do you focus on today? Well, yes, I've moved several steps since then. And for the last 30 years, I've had my own private practice in or in Ashland. And for the last 20 of those years, 10 or 20 of those years, I stopped taking insurance. So I am a people pay to come see me. And if they have insurance, they can build their insurance. But and I respect their insurance, I do my best to get tests covered with insurance. But I've been really calling my own shots and practicing practicing medicine outside of a group, which Todd, I mean, I'm sure you know from talking to younger physicians, it's a luxury younger physicians don't have. If you graduate from medical school with a quarter of a million dollars debt, you can't exist on the salary I've existed on having graduated from medical school with $10,000 worth of debt. Great. So you so you've shifted so you now have a bit more freedom and control over what you what you do with your patients. I have complete freedom within the bounds of, you know, not safety and safety, obviously, for the patients, which has been there all along. But understanding that I'm practicing sometimes I'm using off label applications for medications and patients have to understand that. But and they, you know, they're financial constraints. But one of it, since I primarily work with older patients, and most of them are on Medicare, Medicare really has great financial support for the kind of testing I like to do for patients. So that is a bonus. You mentioned older patients. So is that a significant chunk of your patient population then? Yes. And I'd say for most of my new patients, they're middle aged and older. And most of the patients that I've had for 20 or 30 years weren't older when I started working with them. But now they are are They followed they followed you through through the years. That's that's great. Yeah. Yeah. So then let's turn to your website, Dr. Deborah MD. Can you tell us a little bit about that? How does that work in terms of how much of your attention is focused on the website versus your own private practice? And yeah, tell us what is on that website? It was in about 2011, 2011, that I really wanted to have a reservoir of information out there suitable to share with my patients. And I devoted quite a bit of time to writing articles on topics that I was talking about with more than one patient. So I wanted to have the information there. And I accumulated information about, as you said, auto immune disease, about osteoporosis. And as my practice kept expanding or shifting as people get older, I will go back to an article and say, Oh, my goodness, I don't do that anymore. You know, this year has been a big learning year for me with osteoporosis. And it's I've, it's been a reminder that this is not a shameful thing to say, Oh, Mrs. Wolf, I know I've been seeing you for five years and telling you to do this. But I am changing that today, based on what I've learned this year. And much as medical school encouraged in every graduating doctor, you're going to have to keep learning all your life. I think the caveat to that that needs better clarification is you're going to be changing your mind all your life. This is great that you have an open mind, you're continuing to learn and revise your, your previous ideas. How do you stay abreast of advances, you know, through the literature through conferences? How do you, how do you stay on top of these updates? I must say this is where social media has become very helpful. So I'm in several listserv groups on email, about 10 years, five or six, seven years ago, Gary Taubes, Mark Cucasella, myself, and a couple others were the first 20 or 30 people starting a low carb physicians group. I don't know how many members there are now. I mean, there's hundreds. So I'll get a notification. For instance, there's been a lot of discussion recently about the comparison between a vegan diet and a more paleo diet and how they were compared. And I get all the information, the citations and the discussion people, different people with varying opinions on social media itself. I try, I try to stay off Facebook and Twitter X hate to do that. But I go or to scroll for just today, I saw an article I've been looking to delve more into, which is the relationship between two different subcategories of white blood cells. And if you see the ratio between these two categories of white blood cells increase, you that person is at greater risk for vascular disease related dementia. So then it becomes so that's not only just interesting that there's a marker, but it means you have a measure to modify. If you see it's abnormal in somebody, you have an idea what might be causing it or you have to really look for it. And then you modify it. So it was because somebody I follow, who's more of a has a better way of receiving initial primary articles than I do, shared it. And I just scrolled past the political stuff this morning and kept looking for all the details about the neutrophil to lymphocyte ratio, which was my point of investigation this morning. Yeah, this is great. Well, I was looking at your website, it's really got a lot of good resources. And and but it starts out with these, these elements that you emphasize in your practice, eat real food and choose organic and sustainable, engage in an active lifestyle, and supplement and integrate your care wisely. And these are great principles, they're kind of general. So maybe you could give us examples of some patients that you've worked with where these really helped pick whichever one you want to jump in with. So recently, and you and I talked about a little bit, I was lucky enough to participate in this cognitive pilot project, who enhanced cognitive health. And it was one, two of my patients, when I started subjects in the trial, were non meat eaters, when I took them on. And both of them, for different reasons, were anemic, very profoundly anemic. And guess what?   So these two individuals really needed to increase their iron. So we gave them supplements, because they were vegetarian, they weren't going to have significant iron in their diet, because they were also, well, they were eating a lot of vegetables, but that didn't do it for them.  And so I had to go through and the resources were on the website.  And what we finally got to because the most iron nutritious food happens to be the liver from chickens, more so than beef liver. And they both said, what? And I had within the process of the study got both of these vegetarians willing to eat liver. And the part I was going to get to is I have these great liver pate recipes on my website. So I could say, not only could you read about the whole process and the biology of it, but here's some nitty gritty ways to prepare chicken livers. So you'll like them and fix the iron for both of those people.  By the way, I love chicken liver, chicken liver, bacon and onions is one of my favorite recipes. And it and I do notice it. I just have more energy and sharpness afterwards. But it's maybe an acquired taste. Not everybody goes for it. Yeah, but so these recipes for the pate have three different flavors. And I would invite you the next time you make your liver and onions that with bacon to cook up a double batch. And when you're finished, put it in your quesanar, your food processor with some extra butter and put in a container in the refrigerator and you have pate pate. That's a great idea. I love that. Okay, so you've you've hit on eating real food and supplementation where where it can help. How about engaging in an active lifestyle? It's challenging for some older patients to get active again. But have you had success there? And has that helped with any of the conditions that they've had? You know, the engage in an active lifestyle really needs three different little subheadings. One of them says is mental. You and I were talking about agility with social media and electronic communication is part of what people my age sometimes say I'm too old to learn that and I'll encourage them they need to do something because you need to keep your brain active and engaged. And that I've seen people so in the pilot study we did we signed them up for a brain training service and we could actually chart their scores. So we could watch their mental agility improve the part of the study that we encouraged but was hardest to do was socially active. It's important to have a group of friends you like to hang out with or that you play bridge or you go dancing. And the we didn't quite know how to manage that because there's also privacy and now how do you make people get together? Well, the because of the third component, which is to get them to be physically active, we had them come to a gym, which at that time was on the property that we shared with them. And they all ended up in the gym at the same time. And they would make dates that they will all come back to the gym, you know, on Tuesday and Thursday, so they could not only do their work but hang out with each other and compare what they've been what progress they were making or not. And they would come back to me and say, how come you've done that with her and you haven't done that with me, you know. So it's important to be active in all those three ways. I think my favorite story about social engagement actually came from a patient who was not part of this study, but her husband brought her to see me about five years ago. They'd early on learned about the possibility for reversing her Alzheimer's disease. And we made pretty good progress. We really did. And she was more conversant. She never lost the ability to dress herself. But she wasn't interested in doing memory games. She wasn't interested in doing some of the engagement we wanted for her. And after a fall where she broke her hip and amazingly got out of the hospital and was fine afterwards, her husband hired an aide to help him. They're both in their 90s by then to help him with her activity level. And this woman and my patient became like schoolgirl friends. And they'd say, we're going for a ride today. John, we want to go to the coast.  And you just do the driving and tell us where we're stopping for lunch. And he credits that, which this is the kind of thing you can't prescribe and you can't plan for. You can just advise and hope with keeping her bright and lively. And she had been placed in a memory care facility and they kicked her out. She was too high functioning and they needed the space. That's wonderful. And I love how you've tied the physical activity, mental activity and social activity all together. That's the active lifestyle. It's not just just one individual piece. That's great. Well, now you've alluded to this study, the precision medicine approach to Alzheimer's disease pilot project that you recently published last year with a group of other researchers. Let's get into that study. Tell us a little bit about the goals of the study, the measures of success and what you learned. That was a great adventure. You know, I never thought I would participate in medical research. So I feel very lucky to have been introduced to Dr. Bredesen's work and to be able to be participate in this team. And this is Dale Bredesen at UCLA, right? He was at UCLA. He's now really working more independently because he's doing something, well, get to that, wrap that up in a minute. But so he's working more independently now and still very interested and always involved in research, but more involved in social media than UCLA right now. I think his company has an active presence there. So we three clinical physicians recruited up to 10 patients and I'm in a rural area. I only got five. They each got 10. And we wanted to see if we could apply the principles of the Bredesen protocol and measure success over nine months. So it wasn't blinded. It wasn't randomized. They knew what they were getting into. They, we tested them cognitively and that was with both a test called the MoCA test, which is like the MMSC, a 30-point score test that you could do in the office in 10 or 15 minutes. We did an unusual test called the AQ21 where we asked their loved one, how are they doing? Are they, are they forgetful? Do they have any trouble knowing where they are that those numbers were kept? We gave them online cognitive tests. So these had to be people who were moderately adept with a computer and we did MRIs and we did all that at the beginning. We did a lot of the testing every three months so we could keep ourselves on track and help identify any places. We were letting details slide and at nine months we repeated all those tests. 22 out of the 25 had marked improvement across the board. So they're marked improvement both in the functional test and also physical measures like the MRI brain volume. Physical measures like their waist relative to their height, you know, so their whole metabolic health issue, but yes the MRI. So some of our patients had had swollen MRIs at the beginning because of some toxicity and this is a whole curse of the modern world that our ancestors did not. They had apex predators to deal with. We have mold and pesticides. So anyway some of some people's brains were swollen. Those brains shrank a little bit. Some people's brains were atrophied. They either atrophied less or actually regained volume over the nine months. People's cognitive scores improved. Their general health measures improved. 22 of the 25 improved markedly at nine months. The three that didn't were primarily associated with so one of the toxins that is very insidious to the brain yields from our wonderful creation of sheet rock 50 years ago. So I have a sheet rock wall here and there could be mold on the other side of it. Like if I had a stone house and I had mold on the walls I'd clean it off. But if I have a sheet rock house I could have mold on the outside of it from that nasty flood that went through which of course climate change is making that happen more and I could not know it. So we had a fair amount of mold toxicity probably 20 percent of all our or 25 percent of all our participants in the trial and two of them were not able to remediate because it was during the pandemic that the trial wrapped up. So three of the 25 didn't show marked improvement and we really understood why but 22 of the 25 had marked improvement in diagnosed Alzheimer's disease. I mean they really did meet early Alzheimer's disease criteria over a tiny period of nine months. So the inclusion criteria were mild to moderate cognitive impairments not extreme and not normal. How do you define this mild range? So on the MOCA score which is a 30 point scale 26 to 30 you know if I gave you this test you might go oh right I forgot it was the 19th I was thinking it was the 17th because that's the you know you could have a few things wrong. You could only remember four of the five words I get you to remember so 26 to 30 is considered normal. 18 to 25 is mild cognitive impairment the upper end being mild and the lower end really sliding towards moderate so we had people as low 17 out of 30 I believe but they had to be able to do the online cognitive test comply with some of the record keeping we asked them to do we asked them to check the ketone level in their blood so they had a ketogenic diet of sorts. You know the ketogenic diet I'm sure you know can be everything from I'm just slamming down bacon butter and steaks to I'm eating lots of vegetables and some olive oil you know and of course we aired on that side because these people most of them had the ApoE4 gene which puts you at risk for both cognitive impairment and vascular disease and makes your body just love and cling to saturated fat so we did our best to moderate the saturated fat intake but I told people don't let that stop you from eating eggs you have to eat eggs every day really good for the brain but you don't need to slam down butter and cheese and bacon. So you're mentioning some of the dietary modifications can you go over you mentioned this is Dale Bredersen's protocol but it was multi multi factorial right it was not just diet it was exercise sleep but so what was the full set of interventions and in what way is this precision medicine was it's did everybody do the same thing or was there some adaptation that's a really good question so we started out by testing everybody so I could have somebody whose iron levels were too high to compare with my two patient I have two patients I've just talked to you this week whose iron levels are too high and I tell them they have to go give blood and stop eating from a cast iron pan and lower their iron and I had those two vegetarians and I had to talk into eating chicken liver so we tested them on every parameter we tested their sleep to make sure they were oxygenating all night and didn't have any degree of sleep apnea we tested their level of fitness and they they were afforded the luxury of a private personal trainer to work with at times several meetings with them they had a health coach who helped them do the diet but the I can't emphasize enough that the treating the testing was really selecting out the individuals so my five patients two of them had real significant problems with anemia the two women had no hormones because of they of course in menopause and we learned through the process of the study we also did a little bit of genetics evaluation on everyone we learned what somebody might be most vulnerable to so for instance people of the ApoE4 gene if it has its partners in crime it's a greater risk and you have to have higher standards for how much you raise their ketones or lower their homocysteine or make different applicate lower their degree of inflammation help them handle inflammation and some of the my patient one of my vegetarian patients didn't have the ApoE4 gene at all so you know if he wanted to eat a little saturated fat and his cholesterol stayed in good numbers we could do that with him but we took all those elements of the evaluation into consideration and it was a heavily managed team and you know brain care it's so much easier to get keep your brain healthy from the get go rather than to repair it when it's suffering yeah so very interesting so you did this full assessment multiple dimensions some of it was metabolic measures or things like sleep or fitness a whole full assessment and then you designed a program for each individual it was somewhat individualized so i guess one question i have is this is unlike a lot of studies where everybody's getting the same treatment right here you're individuating um and so to what extent was that design of the program uh following a set set of principles and to what extent was it a subjective assessment well i think this patient you know it was a little bit weak here and we'll add some coaching here so how well can this be replicated if there is subjectivity versus a set protocol those are really good questions that get to the heart of the matter and really from the get go Dr. Bredesen had to jump through hoops for about half a dozen years to even get permission to do this pilot project because it was individualized protocol application and to answer your question we have a 60 page protocol that delineates items such as for instance um what are your omega-3s and omega-6s like in your blood this is the target these are the kind of uh interventions we would use to get it there what's your level of uh my gentleman friend who ended up liking the chicken liver pate was eating wild uh wild salmon should have been toxin free his mercury levels were significantly too high what how far down do i bring them and how do i do that so all those steps were delineated but so for instance one of the to bring his mercury down we might use a supplement such as glutathione i chose the glutathione i wanted to use or how i wanted to boost his glutathione but the use of glutathione itself for every intervention we had about four options and the practitioners were able to choose two to four of the interventions as they sought suitable so you're right it it is very difficult to say well this couldn't just be programmatic you couldn't just say for Alzheimer's has this this this and this and if you have them do that that that and that it does have to be more nuanced but i'm on a path of looking to see how much of what we did in that trial which is a 60 page protocol managing oodles and oodles and oodles of tests and test results how much of this could we do as primary care physicians so for instance if you test people's thyroid hormones and we tested them in a complex level what are the levels of all the different hormones and do they have antibodies to thyroid do they have autoimmune thyroid disease if you ask a conventional endocrinologist they have certain standards for how with an older population you replace or don't replace thyroid hormone for cognitive patients we just have to redefine that a little bit so how could i redefine standard of primary care you give a primary care doctor who's not going to do oodles and oodles and oodles and oodles of tests give that primary care doctor a leg up if you i don't know if any of your relatives or patients or colleagues or friends and you're not a physician but um have had to have had the diagnosis of Alzheimer's from a neurologist they say well eat healthy and come back when you need medication and um you know you should watch out see how they're driving and let us know when we need to take their driver's license away they really they test three things b12 thyroid and syphilis it's kind of all they test and they still test syphilis i think um how could we expand that to increase the population that is captured by the initial throw of the rope and something helpful offered without having to study for three years with dr bredison yeah so i think you answered part of my question which is even though it's a complex protocol it is a protocol it's 60 pages you've got specific recommendations for what to do given certain test results um there's probably some flexibility there but it's not just a an open-ended protocol right you have to follow this now i i imagine and again this was you said a pilot study i i'm hoping there will be follow-ups right based on this where you can do dive in more but did you learn anything from the study in terms of that might even be surprising interventions that you thought were that it ended up turning out to be really effective maybe more than you thought and others that were less clear that's a real that's a good question uh and i would say with each patient i had surprises both disappointing and encouraging uh and by the way there is a secondary trial going on that is randomized and there is going to be a control group and it's actually their protocol is probably 160 pages okay they're doing way more testing and i opted out of it because my rural area i knew i wouldn't get anybody to um submit to all that test it's a lot more management and and i'm really more interested in the how do we get into the entry level of this and help way more people not need that more sophisticated care but i'd say my two biggest surprises in care are uh the efficacy of addressing mold toxicity if somebody does have sheetrock that's accumulated mold behind the walls i i really didn't want to learn about mold you know we didn't learn about it in medical school i know how to raise people's iron i could talk about homeless cysteine and b vitamins and methylation but i want to learn about mold and a man uh brought his wife in to see me and she was not part of the trial but it encouraged me to pursue this study and end up being part of the trial uh and she had been a business manager and she could barely dot her eyes and cross her t's and she was just stumbling along and we did diagnose her with mold toxicity and this their family was a perfect example of the fact that uh you and i and two other people could walk into a crowded bar and one of them leaves because they can smell the mold and it's bothering them too much and the other three of us stay and only one of those people ends up suffering from mold toxicity so my patient her husband was fine he lived in exactly the same setting as she did so he could do all the oh my goodness i found mold behind three different walls he ripped it out we addressed her mold and that's kind of a little bit of a complex process and a never-ending evolving protocol for that and i said you know uh great i'm great she seemed better when i saw her in september i'd really like her to come back for a follow-up and he says he can't her practice is too busy now that she's back at work um she doesn't have the time to come in and see you okay i'll take that that made a big difference yeah right so treating mold made the biggest difference and what was the other surprise you mentioned there was a second uh surprise putting women on hormone replacement therapy and having their brains wake up there's uh uh in the conventional medical world nobody would put women on hormones much less even continue them on hormones at the ages that we were following people in the study uh but luckily a study came out of korea a couple years ago where they did take a group of women 65 to 82 put the hormone replacement therapy the exact kind that we like to use unlike the kind that caused breast cancer 22 years ago which is still the only thing stuck in most doctors minds so these elderly women in korea had cognitive improvement and no adverse side effects followed in that short limited older women's application of hormone replacement therapy so we've all felt empowered to do that and start my woman who had such a great time with her backseat of the car friend i started her on hormones at her at the age of 87 and she did great she thought it was everybody thought that's one of the things that will occur up uh as part of the whole protocol but for some women that's a big deal so you gave the hormones at what age 87 that's quite yeah that's that's great that's great so let's talk about hormone replacement therapy i i i read a little bit about your work in that area and listen to a talk that you gave on it's very interesting but maybe for our listeners here start out by relating that to evolutionary health you know why aren't why isn't our normal hormonal balance adequate in today's world and thinking about our evolutionary history mismatch whatever why would we even consider replacing hormones why can't we do it the natural way and age and i would say well some women can and depends how hungry your estrogen receptors are in your brain and in your bones i think where it matters the most so when from the our earliest records menopause used to be a little bit earlier used to be about 10 years earlier but our life expectancy used to be a lot shorter so a woman tends to be still pretty healthy for 10 to 15 years after menopause and after that period of time is when the ravages in the brain or osteoporosis or even increased risk of heart disease in our modern world more so than in our ancestral world okay so evolutionary evolution didn't see the need to continually allow women to generate these hormones past sort of their normal age of reproduction because historically there was no selective pressure there but now that they're living longer there's a problem there's a problem and you know a very interesting thing about this Todd did you know that there are only three animal species in the whole world that go through menopause humans pilot whales and killer whales and for i don't know about the whales but for us there's a hypothesis that i as a grandmother am more helpful to my daughter's offspring growing up healthy if i take care of the children and don't try to compete with her for her husband's attentions so that's the grandmother hypothesis and enabled us to you know it made sense that for 10 or 15 years we were past reproductive age but if i didn't fix my pooch over there at her age of 11 she'd still be able to have puppies okay so there's this connection with estrogen and the brain and you're seeing these big benefits but you you did allude to this earlier view based on some early research that hormone replacement therapy was associated with cancers but i think you've talked you've talked about the need to be very specific about which kinds of hormones and how they're delivered can you say a bit more about that that's exactly right and you know and hormones were kind of the darlings of medicine in the late 1900s and in 2001 women's health initiative trial interrupted because women were getting breast cancer looking at that same group of women what we found out was that when women take the synthetic progesterones progestins and in those old days and i think they still have it provera it markedly increases their risk of breast cancer and frankly it only it it increases their risk of depression cognitive impairment brain fog metabolic imbalance it's a terrible substitute for progesterone and anyone who is still using that is putting their patients at risk for breast cancer the estrogen form that was used at the time and is still to some degree used is an oral estrogen and that can actually be bio identical but when it's oral rather than apply to the skin so i like to use either these tiny little patches women wear for a few days or a week or a cream that they rub in when you take it orally it is transformed by the liver and some of those first metabolites increase your risk of blood clotting therefore heart attack stroke it's not a huge increase so some people say well you get through the first year you're good to go you can take it orally but i don't play around with it so i always insist that people use a topical application of estrogen and real bio identical which the that only comes in real bio identical forms if you took the estrogen and progestin that they used in two in 2001 that stopped the study you could take them and your own levels of estrogen and progestin would not be elevated in your blood because they were not human in any way so bio identical means the ones we use now that i use now and all my immediate colleagues use now really pump up the levels of the estrogens that we've had in our bloodstream all along okay so it's a transdermal topical kind of application and that's metabolized differently than orally through the liver it is and also your it's a different uh it's the estradiol or or it's estradiol and then the progesterone can be either topical or oral and you know one of the things i like to point out to people is that they'll come into the office perhaps with their husband or there'll be a man in the waiting room and Todd you i don't know how old you are but i assume you're over menopause age past 52 you have more estrogen in your body than a non hormone receiving woman has at her age because your body really smartly takes a little bit of your testosterone in terms of industry turns it into it yeah interesting okay so um that's one form of supplementation you found effective um what other areas you find supplementation helps say with with vitamins like d and k2 or are there other areas where you find supplements are really helpful besides the hormones yes and and i'm i'm a fan of a good multi vitamin because otherwise the list just gets incredibly long but we we do use individual vitamins and actually Todd one of the things i've learned this year and i've been giving people k2 for 20 years is that is not enough so i've pulled back everybody's k2 and i now give them a combination formula of k1 and two different kinds of k2 something i've learned from this brilliant chiropractor who's really looked into bone health so for bone health or heart health for brain health better with this combined k2 but i i do use some of the individual vitamins um sometimes people need extra b vitamins there's a test that really i think most doctors look for which is homocysteine a molecule in the blood that serves a good purpose in our body but if it's too high it's inflammatory and the criteria are different and for cognitive health what's too high so we get very adept with different b vitamins depending on somebody's genetics which b vitamins would work the best for them to optimize their homocysteine so there are lots of little vitamins that are tweaks like that are iron as i said for my anemic patients i think the other two really three remarkable categories to talk about are the oils like i have people use olive oil as well as taking fish oil as really like a supplement so that they can muster up good ketones so have have a little shot glass of olive oil with your dinner as well as cooking your dinner in olive oil we use detoxification supplements mentioned glutathione earlier we in this valley that i live in almost everybody has some degree of toxicity measurable with gasoline red residue or pesticide residue because we're a high mountain valley and lots of cars go through and the third category is something that i really appreciate dr brettison's teamwork before i even met him in this which is we use some iirvada herbs so i'd say my favorite i'm just going to pick out of a hat is one called ashwagandha it's an adaptogen yes an adaptogen right so it's wonderful for our stressful life because it can reduce cortisol and help you sleep it lowers ldl cholesterol which a lot of apoe floors have a problem with because their body loves saturated fat so much and it also has been shown to be effective in some pre-non-human studies but for removing amyloid from the brain you know this is like the ideal supplement for somebody with cognitive impairment due to Alzheimer's disease so deba with supplementation uh how much of this is uh is is just generic where everybody should be taking this and how much of it's based on testing do you do some testing of your patients and identify deficiencies and then try to correct them or are you just saying everybody should take a multivitamin how do you uh how do you approach supplementation and you're you're right i do test my patients both by my conversation with you oh you have trouble going to sleep at night and you wake up at three o'clock in the morning i bet you need some ashwagandha so that way oh i just did your lab tests in your home assisting is fine you don't need any extra b vitamins or i tested it and yours is really high you do need some extra b vitamins i'm also a real fanatic about which multivitamin you're taking so i think everybody should take vitamin c every day and frankly i don't care what kind of vitamin c you take and if you skip it for a week or two that's fine but you know you're not eating a bunch of vitamin c you should take it every day but then there's a whole continuum where on the other side no you're just taking this particular supplement for this reason that we identified in this test and when that test is normalized you can start taking that supplement intermittently or not at all so you do a lot of testing metabolic panels these these kinds of things and and also how do you can't that get expensive can you sort of do over testing can patients afford this or do you find that the the cost benefit is not not not so bad here Medicare covers Medicare covers it most insurance covers it if you know how to code for it you don't just send and i will say i'm affectionately known at the local lab as dr dracula but i like to point out to people that each of those 12 or 14 tubes of blood only has a teaspoon of blood in it and that's much less than if they were giving blood but it is luckily we have a really nice lobotomist who kind of hypnotizes the people why she sticks in the little needle and you know changes tube after tube but Medicare largely covers it and even i referenced mold treating testing and treating there's one company that contracts with Medicare so we can test for mold toxicity covered by Medicare the very expensive Cadillac test for Lyme disease is covered by Medicare and i would say all those where i say Medicare i would say most but not all insurance also covers it we also scurry like busy you know rats on cheese to help patients who don't have insurance find self pay ways to get maybe a life extension orders a very affordable lab panel that isn't everything i want but sometimes we put a couple of them together or some of the local labs have discount policies we can apply we try not to let that be an obstacle because frankly the eating well going to the gym if you need help because i've told you to do some resistance exercising and where else are you going to do your high-intensity intervals food costs money supplements cost money help cost money and it would be it's great if the testing can as much as possible not be an obstacle to understanding the problem so you're an MD but you also have a much wider spectrum of modalities that you look to some might say that a lot of what you're doing would be what a naturopath might might do but you're also an MD so i take it you still when needed treat with pharmaceuticals is that the case i do so you're so you're combining you're combining conventional and ancestral and i have greater range of what i can order for my patients and have insurance cover it the naturopaths do there are some brilliant naturopaths i'd say that there's a naturopath in this valley there's two who are one of them antibiotic use one herbal use some of the most renowned experts on treating patients with chronic Lyme great i'll use both of those i'll refer to both those naturopaths okay now you're a member of physicians for ancestral health which is a really interesting group um tell us a little bit about that organization uh what's what's their uh sort of goal and what kind of what range of specialties do they represent well i i think our goal uh has morphed over time and and at this point we're just hoping we can keep getting and we can manage to have another meeting our region so we're a wide range of specialties people from the low carb world there's a doc who's a pain medicine doc and an emergency room physician there's a researcher from the university of washington neurologist people who actually aren't even physicians uh daryl edwards who i'm sure has been at several ancestral health meetings has been at some of ours so i would say we're an incredible team of minds that agree on many principles and we have our healthy respectful disagreement about things as well and we've come together for retreats maybe really not more than half a dozen times where we function as a group of nomadic herdsmen who have come upon each other and share great ideas and inspiration and then we really go off and people are doing some pretty remarkable uh contributions to medicine in their different ways we aspired early on to be more a network of physicians that would be a referral network and i'd say that is something that is a failing that we were unable to really come up with that and do because i think everybody was so already had an agenda of their own you know wanted to be more in the low carb world or wanted to be more in the brain world uh it's very hard for a physician a patient who's living in a locale where there isn't a physician who has anything remotely touching any of what we've talked about today and i do want to circle back to something i was saying about dr brettesen which is he has created a website called apollo health where a patient can come who's living in an area that's remote from any doctor who can hand help them with their cognitive work can work through the website and self order certain labs and get supplement recommendations and then uh witness a patient who was in my office yesterday dr brettesen will say or the program will say you really come to the end of what we can do you need to find a physician to work with whether that means traveling from chicago to california to oregon as some of my patients do or finding a physician who's closer to home or who's willing to be a little bit flexible it's a real problem that physicians for ancestral health wasn't able to do there was also a network for a while called i think primal docs network chris armstrong and gary tab started we tried to have a referral network so people at large who get excited by things that we're talking about can find a physician but it's not always easy okay so it sounds like there has been value in the information sharing and sort of networking among and across doctors and it probably helps keep you feeling sane that you're not an outlier right you can commiserate you can share uh and but these are accomplished physicians from all over i think it's mainly the united states it's not overseas or we we frequently have had one person from overseas and then a different person and if you count canada yes a few canadian well we'll count them uh so okay so it's mainly this group and it's internal sharing but let's say i'm uh very inspired by low carb or paleo um i've also read some things about alternative ways of looking at the function of cholesterol but i go to my my family doctor and he says you know i'm gonna i want to put you on a statin or you know we're gonna treat let's say you have osteoporosis and you're gonna get certain drugs for that or maybe even mood conditions they'll we'll put you on an ssri rather than thinking about dietary approaches and so you're frustrated and you what do you do do you print out some research to this doc do you try to have a conversation with them or do you just give up and uh and and find somebody else how would you how would you advise the paleo inspired patient to deal with their conventional uh family doctor or specialist uh that's a challenging question and i would encourage them uh it's really important for each individual for you to remember that you are your first physician you are the one responsible for your health and so if you've done your research even whether it was on the internet and or you are inspired then to read a book you know or uh go to a conference and you really want to you want to see if cholesterol really is the problem where there's something else going on uh and maybe your cholesterol is actually totally fine i encourage people to very as carefully as a doctor who's studied it the the research over the years that we rely on kind of unthinkingly sometimes for most doctors they don't really take a precision medicine approach to the patient so if you want a precision medicine approach to you you have to be the responsible one to take that step and most of the so that for someone to be my patient they have to come see me and have care or they have to see somebody who's licensed in their state uh the institute for functional medicine probably has the most open minded group of doctors that you could just pick somebody off a board and have a good chance that they'd be willing to say well gee i would have given you a statin but if you want to experiment let's agree to monitor it this way so i think the functional medicine world is a good resource can you just uh give us the the link what would the link there be for that that resource the institute for functional medicine and it's fine to a practitioner near you and they might be a and if you have any trouble finding it i will get you the link yeah we'll put some of the links in our show notes so so thanks for mentioning that uh but i have a number of patients who i don't who don't are i'm not really taking care of but i'm consulting i speak to a woman in france and i say this is what i'd like you to get your doctor to order for you and this is what i'm gonna we're gonna have your friend over here buy from the supplement store and ship to you um so you can hire a physician who is like-minded as a consultant who might be best able to take your individual situation and help you navigate with the doctor you're seeing if you can't find a truly like-minded physician either through the functional medicine world or through you know okay so so it's possible to work at a distance with your doctor as a consultant and arrange tests and things like this and uh you don't always have to be seen in person to to be effective here right that's right and and i think the real testimony to that is dr bredesen's program who you know people can go in and never see anybody and do testing that evaluates their home assisting their anemia level and their cognition and that's tricky to it that only goes so far so it would be great ideally then to have somebody who could order some other tests and perhaps help you find someone through functional medicine would be a good world who might help you with hormone replacement therapy even though you're 60 and your mother had breast cancer you know there's there are ways around that yeah and then you know we don't want to give up on our local docs either right so is there a way you can let's say you like your doctor and and and they might be open what can you do to help educate them without seeming uh to you know to be arrogant or or or obnoxious uh can you give them or there's to doctors trust certain uh journal research or should you point them to certain websites how do you have this conversation i think the approach of your physician has to be as precision psychology approach as the my approach to a patient has to be a precision medicine approach so in general say if a patient is reaching out to me with something new and we can talk about it pretty efficiently i enjoy that but if they say here's an hour and a half video or a 300 page book i want you to peruse for the benefit of my health concerns doctors are really busy people and it is problematic to bring in new literature and to find you have to know the sort probably the best way is to end up doing a sport that your doctor likes doing and strike up a conversation on the ball field or in the rowing shell and say you know i've been reading a lot about what do you think of this dot i mean i don't know but bringing when people send me this is a great video to watch if it's three minutes i'll watch it if it's 45 minutes i won't want i mean i'll write to them and say do you want to pay me to watch this um i've got a busy day unless it's something like oh great i've been dying to see this video so we tend to gravitate towards what is already impressive to us and and you don't know what's going to be impressive to your doctor and it's not always research i've sent research to former colleagues of mine from the world of family practice and sort of go huh you know there she's going again talking about her integrative medicine and no i'm sorry this is really conventional medicine we just also use supplements and diet you know very good advice doctors are people too and uh there's there's no one size fits all approach it's a human relationship like any other right so i like your i like your point about building the relationship and then then you're more likely to be successful rather than hitting them over the head very very good well this has been a great conversation lots of good information and and again i'm hoping you can send me some links besides your your great dr debor md website and we'll we'll put those on the show notes wonderful conversation um i hope we can also get you back when we start up the conferences again i'd love to that's great well thanks a lot debor for talking today it's been a pleasure thank you Todd i enjoyed it a lot thanks for joining us on this episode of ancestral health today we hope you enjoyed our discussion on how evolutionary insights can inform modern health practices be sure to subscribe to our podcast to catch future episodes