Somewhat final version (for wdd)