more or less final version