mainPage functionality