Converting to java