holy fuck this is complicated