Partially solved the cursor problem