New mip treatment 3

Third attempt after pull requests #80 and #113.