removing extra output in Java Engine