Updated code to reflect new web page and account for new cases.