fixing cursor positioning -- seems to work, now