work on #190
#191 done. Started #9. Work on #41. Work on #190. Should have made separate commits but kind of a large patch