Modified to accept any filetype