save-raw and load-raw functions updated