reworked, high-level behaviour seems okay now, next step is using an empty cursor