use fread instead of fgets to allow new lines