working on the main page code