Add beginning of cursor code