add smart-loop and naive-loop