#22 add new func and fix bug