Main Search Cum Model Compilation