Nchinda's java code