finish several functions. but test failure