Added recursion and organizer functions to the script