Changed to Java implementation