rough partitioning done in parent.c