more work on the battle functions