read file, compute normalization, h(x)