Changed Heuristic Function to square