Finally finished implementation of the cursor.