scope issues

some scope issues was why some things were weird. But more weirdness
remains.