straighten the "partitions" function