Closes #29 and #18