Finished insert function