insert function from class