Ok, so I rearranged some of this code to make it easier when we do switch to the MC-based version, as you said here.