Improvements to the chain generator