MLSE cost function added