modified readfile