added insertion function