replace levmar with linear optimization