Updated to try and make usable in Android