substantial debugging but WIP
reached a stable equilibrium