set values of nr and nw