Need to make it work with files