A more easy way to handle the cursor

and more easy to implement.