cleaned up process.c code