some edits to fix animations and saving plots