bugs removed. finalizing recursion.