changed cursor implementation, maybe this works better
reworked cursor