This is a fucking rewrite