Initial code for #186