Added function resnorm