#21 add new func and fix bug