ReadFromFile function

Reads data structure from file