Made changes to allow doc length normalization