Added recursion and formation changes