added ability to read models from a file