reg algorithm changed for report purposes