private DataModel loadFromFile(File pathToFile) {
        
        DataModel dm = null;
        if (pathToFile != null) {
            ObjectInputStream ois = null;
            if (pathToFile.exists()) {
                try {
                    ois = new ObjectInputStream(new FileInputStream(pathToFile));
                    dm = (DataModel)ois.readObject();
                } catch (Exception ex) {
                    Logger.getLogger(SaveModel.class.getName()).log(Level.SEVERE, null, ex);
                }
                finally {
                    try {
                        if (ois != null) ois.close();
                    } catch (IOException ex) {
                        Logger.getLogger(SaveModel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }
        return dm;
        
    }