recursive method script