finished iOS implementation, working on android JNI