added implementation according to Chandy/Misra