basic cursor code