learning io and loops