fixed recursion, need to find bugs now