MIC1 code. To be reviewed and tested further