Adjusted with comments from cmr, Niko, Patrick, et al.