added ability to use cursors