My indentation is not quite right here - I'll fix it up before merging.