corrected indexing error in read.fun