made some pdf adjustments, rearranged html structure, added functioning exiting function