added insert function in class