Add or modify some functions for testing the new method