add init version of insert function