Update validate-file.sh

basically re-wrote it