Added modifications to code to improve the results and comply with
requirements of PAN.