clear "wc" and "res" in the beginning