updaing the java code