merged normalization and coefficient loop for performance.