porting the MICO code from mxchip official site