Organized MIC code and fixed ratio bug