Updated with jxbattle code