Checking path length as well