changed IFS from local to function to global to script
Minor changes in non recursive version - deciding to manage 2 separate branches independently for both versions
Added footer for the recursive function