updated Java code once again