modified to accept all files