write a test, fix some bugs