Changed readData method to function

Changed Data constructor