move isValidListHole to outer scope