working version for ulticoder script