better unit testing

close #1