with pep8 compliance, Raises ValueError when heap exhausts in Ward