Closes #10
Almost there for #3, need to add switching logic