joint_write now joint_process. called from main