change insert function and add draw function