File I/O added for analysis