#416 adding the java for the mode