simpler part.c - can drop all the unix crap