recursion changes applied to indexed case breaking code

changes to indexed recursion and types by copying from unindexed.