documented normalization function