check length when comparing with explored