One fix was being overwritten. tweaked so it works.