more rigorous cursor stuff