scratch the java implementation