I added some test functions and fixed some bugs.-Jian
test