cleaned up battle code a bit