This is obviously untested code! Please do not commit code which cannot compile.