birrt completed code, not tested