updated battle.js