major performance improvement; printing result after each round