normalize in log space to prevent underflow!!!!