expanded to recursion and others