working max likelihood in 1d