create calculate_third_page and calculate_fourth_page functions
create calculate_third_page and calculate_fourth_page functions