instead printing while IO, only print the finished list