Add normalize helper function.