Untested changes but they should work