new version fio.sh

fix some bugs and fixed offset calculations