Making minor changes to C and Java versions.