unstable code: see the todos and test