Wrote a readData Function