Writing custom unit models#