added some pseudo code for doBattle()