documentation clarified and fixed recursion bug by removing recursion
loop