closes #15
#17 and #2