A bit more hacking, giving up on this for now.