new version of readAllFromFile