put c code on a diet and made all wls; passes dm tests