Made it easy to switch between old and new code
Added return value reporting to script code in preparation of bash testing