removed redundant methods, made code flow better. made array of activies global, such that it can be received in mainAcitivity class. This was done by creating new method getActivities.