updated the scripts for both bin and dat files