work save (battle code refactored)