This is super broken and shouldn't be merged. There are also no tests of this code. Boo.