initial implementation of insert and merge operations