modified java code