Modified to run on Android