changed asserts in MainActivity to throw exceptions since asserts are useless on android.