finish the interface and conduct test valgrind