sample addjusted to file IO