WIP seems to work now. Squash before PR