Added battleLoop and battleEnd