Pulled in parts of the ulex partial implementation