add main loop #18
add main loop #18