but wait, I see a bug in that code ...