local var 'rc2' introduced so as to avoid a collision with global 'rc'