insert function directly