Saving tree to file is now working