finish docs
useful test cases
some cleanups