fixed tinyfan code