Added some more code mostly for ready data from file.