This function is out of control.  Its impossible to decipher what is going on.  There is way way more than just enabling user highlights here.  It needs to be broken up into manageable meaningful chunks.