working copy. trying to get output vars into  registers after procedures