pull in more of Doug's code