main page code