ported from dlxub1