update to java function implementation