implemented read method for Text class and added test