fix bug and add needed document to every function needed, remove no-use functions for test