added debug messages to utils.Partition