edit a lot

all functions need test