Fix math error to take into the account the possibility that there may
only be one hill; document each method in the class.