Adjusting the function to jave converter