working version of mcu code