Changed result to visited