Removed unnecessary z variable in norm function.