error in previous commit: use square of norm