sorted up file validtor code