make the process a function