additions to Chandy-Misra-Haas, code cleanup