slice creation and saving file