Added JNI stuff to translate from Java -> R