added testthat
remove bug in example