fix to the pre-partition algorithms