edited code for MainActivity