start cursor work, slight refactor
implemented enough for a basic example to work (but very ugly one)