minor changes to saving, updating end index