Extended the cursor code.