debug, recent updates to last two functions