Rearranged some output information to the end of script execution