initialized visited dictionary with initial size of 100000. Performance doubled for level19.