adjust, and add some tests