with pep8 compliance, Raises ValueError when heap exhausts in Ward

sorry for another PR, having hard time with git :)