moved normalization function into separate file