commented the java code