closes #47 and closes #31