Added the looping for the auto quote generation and command control for the function