added createCursor func