modified MainActivity.java