Manual merge of #4, closes #4