Added sequence partitioning code