Made several simplifications