reg_capture3.pl original update as requested by lesson