update MainActivity because I forgot to do so. And clean up code.