debugging 2.0

visited array failing to function properly in recursion