added file read loops