changed struc and add some new func