added a function to read all data