Definition for insert method