borrowing stuff from existing EAGLE ULPs