madl's github code