Fixed undeclared variable minDistance in heuristicY

Fixed a typo in heuristicY to rename Distance to minDistance to fix an
undeclared variable error.