Added Sub-loop routines
Added Sub-loop routine