fixed condition for sequencial read
fixed computing cache index
refactored overloaded methods to single method using default parameters
fixed output file name