added comments, removed some unused/commented lines, added flush and 1ms
sleep to mt_controller