Merging Riese's branch