added some unit testing, very basic but nontrivial