update, almost final version