inital file reading functioning