separating code to read data. working on plot feature