Minor change to function call
Added structure for save to flash functionality