add more tests and fix problems.