Simple maximum likelihood implemented, not tested