Get rid of unnecessary material_left variable