testing seems functional. add some test cases. #17