Improved modseq code