Past history extraction and calculation of PHV

Rename the file before executing. Handle the exceptions that are
generated