Updated with new cursor, has the same problems as the old version.