closes #9 closes #10 and closes #11