Major update of the register program, includes file writing.