tinkering with enhance code
implementing mip method