This closes #9, also closes #5