Finished off the insert mapping function