added rudimentary tests using testthat