addede new function to build databse and insert data into it and new function to change the main page based on user wish