converted to java