Normalize function.