Added cursor function