Simplified some entangler code