Attempting to move to recursive loop but something has gone awry