Added save algorithm to file and load from string